﻿using SqlSugar;
using Zhp.Entity.SysEnum;
using Zhp.SqlSugar.Entity;

namespace Zhp.Entity.Chat
{
    /// <summary>
    /// 聊天消息记录表
    /// </summary>
    [SugarTable("Chat_Message")]
    public class ChatMessage : BaseEntity<ChatMessage, long>
    {
        /// <summary>
        /// 聊天消息归属：ChatUser表的主键ID
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "聊天消息归属：ChatUser表的主键ID")]
        public long BelongId { get; set; }

        /// <summary>
        /// 消息发送者ID
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "发送者ID")]
        public long SenderId { get; set; }

        /// <summary>
        /// 消息发送者名称
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 255, IsNullable = true, ColumnDescription = "发送者名称")]
        public string SenderName { get; set; }

        /// <summary>
        /// 消息接收者ID
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "接收者ID")]
        public long TouserId { get; set; }

        /// <summary>
        /// 消息接收者名称
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 255, IsNullable = false, ColumnDescription = "收者名称")]
        public string TouserName { get; set; }

        /// <summary>
        /// 互为好友共用ID,用作查询聊天记录
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "互为好友共用ID,用作查询聊天记录")]
        public long PairID { get; set; }

        /// <summary>
        /// 消息内容
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "消息内容ID")]
        public long ContentId { get; set; }

        /// <summary>
        /// 消息时间戳
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsNullable = false, ColumnDescription = "消息时间戳")]
        public long TimeStamp { get; set; }

        /// <summary>
        /// 消息发送时间
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "发送时间")]
        public DateTime SendTime { get; set; }

        /// <summary>
        /// 消息接收时间
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "接收时间")]
        public DateTime ReceiveTime { get; set; }

        /// <summary>
        /// 消息阅读时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "消息阅读时间")]
        public DateTime? ReadTime { get; set; }
    }
}
